<?php
declare (strict_types = 1);

namespace app\user\controller;

use app\common\controller\UserBase;
use app\common\helper\MenuHelper;
use app\common\model\AuthRule;
use think\facade\View;

class Index extends UserBase
{
    public function index()
    {
        $menus = AuthRule::where(['is_menu'=>1])->order('sort desc')->select()->toArray();
        $menus = MenuHelper::MakeMenu($menus);
        $menuslist = ['menus'=>$menus];
        View::assign('menus', json_encode($menuslist));
        return View::fetch();
    }
}
